package frontend.components.menu;

import java.util.List;

public class DropDownMenu implements MenuItem {

	 private final String menuTitle;
	 private final List<LinkItem> items;
	 
	 public DropDownMenu(String menuTitle, List<LinkItem> items) {
		 this.menuTitle = menuTitle;
		 this.items = items;
	 }

	@Override
    public boolean isVisibleForLoggedInUser() {
		for (LinkItem item : getItems()) {
			if (item.isVisibleForLoggedInUser()) {
				return true;
			}
		}
		return false;
	}

	public List<LinkItem> getItems() {
		return items;
	}

	@Override
    public boolean isLeaf() {
		return false;
	}

	public String getMenuTitle() {
		return menuTitle;
	}
}
